// packageJ/tagBalance/components/tapChild/tapChild.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    datas: {
      type: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    tapShowChild(e) {
      let {
        item,
        ind
      } = e.currentTarget.dataset;
      if (item.hide) {
        this.data.datas[ind].hide = false;

      } else {
        this.data.datas[ind].hide = true;
      }
      this.setData({
        datas: this.data.datas
      })
    },
    // 二级
    tapShowChild_two(e) {
      let {
        item,
        oneind,
        ind,
      } = e.currentTarget.dataset;
      if (item.hide) {
        this.data.datas[oneind].children[ind].hide = false;

      } else {
        this.data.datas[oneind].children[ind].hide = true;
      }
      console.log(this.data.datas[oneind].children[ind])
      this.setData({
        datas: this.data.datas
      })
    },
    tapShowChild_thr(e) {
      let {
        item,
        oneind,
        twoind,
        ind,
      } = e.currentTarget.dataset;
      if (item.hide) {
        this.data.datas[oneind].children[twoind].children[ind].hide = false;
      } else {
        this.data.datas[oneind].children[twoind].children[ind].hide = true;
      }
      this.setData({
        datas: this.data.datas
      })
    },
    tapShowChild_four(e) {
      let {
        item,
        oneind,
        twoind,
        thrind,
        ind
      } = e.currentTarget.dataset;
      if (item.hide) {
        this.data.datas[oneind].children[twoind].children[thrind].children[ind].hide = false;
      } else {
        this.data.datas[oneind].children[twoind].children[thrind].children[ind].hide = true;
      }
      this.setData({
        datas: this.data.datas
      })
    }
  }
})